<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="./lib/vue.min-2.6.11.js"></script>
    <style>
        body {
            height: 2000px;
        }

        .inner {
            height: 150px;
        }

        .box {
            padding: 50px;
            background-color: red;
        }
    </style>
</head>

<body>

    <div id="app">
        <div class="inner" @click="innerClick">
            <p>sss</p>
            <input type="button" value="chuowo" @click.stop="btnClick">
        </div>

        <a href="http://www.zxyi.cn" @click.prevent="linkClick">点击进入网站</a>

        <div class="inner" @click.capture="innerClick">
            <p>sss</p>
            <input type="button" value="chuowo" @click="btnClick">
        </div>

        <div class="inner" @click.self="innerClick">
            <p>sss</p>
            <input type="button" value="chuowo" @click="btnClick">
        </div>

        <a href="http://www.zxyi.cn" @click.prevent.once="linkClick">once点击进入网站</a>

        <hr>

        <div class="box" @click="boxClick">
            <div class="inner" @click="innerClick">
                <p>sss</p>
                <input type="button" value="chuowo" @click.stop="btnClick">
            </div>
        </div>

    </div>

    <script>
        const vm = new Vue({
            el: '#app',
            data: {},
            methods:{
                innerClick:function(){
                    alert('innerClick 被点了')
                },
                btnClick(){
                    alert('btnClick 被点了')
                },
                linkClick(){
                    alert('linkClick 被点了')
                },
                boxClick(){
                    alert('boxClick 被点了')
                }
            }

        })

    </script>

</body>

</html>